package cn.yj.frame.config;

import cn.yj.frame.event.ApplicationCloseListener;
import cn.yj.frame.event.ApplicationStartingListener;
import cn.yj.frame.event.ApplicationStartFailListener;
import cn.yj.frame.spring.BeanUtils;
import org.springframework.context.annotation.Bean;

/**
 * @author 永健
 * @since 2022-01-18 21:58
 */
public class BeanConfig {

    @Bean
    public BeanUtils beanUtils() {
        return new BeanUtils();
    }

    @Bean
    public ApplicationStartingListener applicationStartingListener() {
        return new ApplicationStartingListener();
    }

    @Bean
    public ApplicationStartFailListener applicationStartFailListener() {
        return new ApplicationStartFailListener();
    }

    @Bean
    public ApplicationStartingListener applicationEnvironmentPreparedListener() {
        return new ApplicationStartingListener();
    }

    @Bean
    public RpcAnnotationBean rpcAnnotationBean(){
        return new RpcAnnotationBean();
    }

    @Bean
    public RpcReferenceAnnotationBeanPostProcessor referenceAnnotationBeanPostProcessor(){
        return new RpcReferenceAnnotationBeanPostProcessor();
    }

    @Bean
    public ApplicationCloseListener applicationCloseListener(){
        return new ApplicationCloseListener();
    }
}
